package pl.nith.battleships.models;

import pl.nith.battleships.helpers.TileHelper;
import pl.nith.battleships.helpers.TileHelper.TileType;

public class Tile
{
	private int row = -1;
	private int column = -1;
	private TileHelper.TileType tileType = null;
	private boolean isOnHitBoard = false;
	
	public Tile(int row, int column, boolean isOnHitBoard)
	{
		this.row = row;
		this.column = column;
		this.tileType = TileType.EMPTY;
		this.isOnHitBoard = isOnHitBoard;
	}
	
	public Tile(int row, int column, TileHelper.TileType tileType, boolean isOnHitBoard)
	{
		this.row = row;
		this.column = column;
		this.tileType = tileType;
		this.isOnHitBoard = isOnHitBoard;
	}
	
//	public Tile(String field, TileHelper.TileType tileType, boolean isOnHitBoard)
//	{
//		this.row = TileHelper.getTileFromField(field).x;
//		this.column = TileHelper.getTileFromField(field).y;
//		
//		this.tileType = tileType;
//	}
	
	public int getRow()
	{
		return row;
	}
	
	public int getColumn()
	{
		return column;
	}
	
	public TileType getType()
	{
		return tileType; 
	}
	
	public void changeType(TileType tileType)
	{
		this.tileType = tileType;
	}
	
	public boolean isOnHitBoard()
	{
		return isOnHitBoard;
	}
}
